; ModuleID = '/Users/aserlili/Documents/Codes/llvm-build/test/OllvmTest/calculate.cpp'
source_filename = "/Users/aserlili/Documents/Codes/llvm-build/test/OllvmTest/calculate.cpp"
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128-Fn32"
target triple = "arm64-apple-macosx15.0.0"

@dec0.str = private global [31 x i8] zeroinitializer, align 1
@dec_status_0.str = private global i32 0
@EncryptedStringTable = private global [81 x i8] c"\FA\FC\F8A\D2r\08\9Fm}\E1\99\8Ej\DF\81\EBYa\D1\06\A6Ac\89\DC\B1\14\D0\CD\819\1D\95\91\01\F4\A2wK{]\E7\ED\FB\13\87\EFz\8F\A4A;\F30\E8\1E\ED*&=;~\22\9D\B7-8q#\9Dn-md 5\9D\C4\92\08"
@_Z9calculateddc_IndirectBrTargets = private global [2 x ptr] [ptr getelementptr (i8, ptr blockaddress(@_Z9calculateddc, %if.else), i64 -9), ptr getelementptr (i8, ptr blockaddress(@_Z9calculateddc, %if.then), i64 -9)]
@goron_decrypt_string_0_IndirectBrTargets = private global [6 x ptr] [ptr getelementptr (i8, ptr blockaddress(@goron_decrypt_string_0, %UpdateDecStatus), i64 -9), ptr getelementptr (i8, ptr blockaddress(@goron_decrypt_string_0, %Enter.LoopBody_crit_edge), i64 -9), ptr getelementptr (i8, ptr blockaddress(@goron_decrypt_string_0, %LoopBr1), i64 -9), ptr getelementptr (i8, ptr blockaddress(@goron_decrypt_string_0, %LoopBr0), i64 -9), ptr getelementptr (i8, ptr blockaddress(@goron_decrypt_string_0, %LoopEnd.LoopBody_crit_edge), i64 -9), ptr getelementptr (i8, ptr blockaddress(@goron_decrypt_string_0, %Enter.Exit_crit_edge), i64 -9)]
@llvm.compiler.used = appending global [2 x ptr] [ptr @_Z9calculateddc_IndirectBrTargets, ptr @goron_decrypt_string_0_IndirectBrTargets], section "llvm.metadata"

; Function Attrs: mustprogress noinline optnone ssp uwtable(sync)
define noundef double @_Z9calculateddc(double noundef %a, double noundef %b, i8 noundef signext %op) #0 {
entry:
  %retval = alloca double, align 8
  %a.addr = alloca double, align 8
  %b.addr = alloca double, align 8
  %op.addr = alloca i8, align 1
  store double %a, ptr %a.addr, align 8
  store double %b, ptr %b.addr, align 8
  store i8 %op, ptr %op.addr, align 1
  %0 = load double, ptr %a.addr, align 8
  %1 = load double, ptr %b.addr, align 8
  %2 = load i8, ptr %op.addr, align 1
  %conv = sext i8 %2 to i32
  call void @goron_decrypt_string_0(ptr @dec0.str, ptr getelementptr inbounds ([81 x i8], ptr @EncryptedStringTable, i32 0, i32 27))
  %call = call i32 (ptr, ...) @printf(ptr noundef @dec0.str, double noundef %0, double noundef %1, i32 noundef %conv)
  %3 = load i8, ptr %op.addr, align 1
  %conv1 = sext i8 %3 to i32
  switch i32 %conv1, label %sw.default [
    i32 43, label %sw.bb
    i32 45, label %sw.bb2
    i32 42, label %sw.bb3
    i32 47, label %sw.bb4
  ]

sw.bb:                                            ; preds = %entry
  %4 = load double, ptr %a.addr, align 8
  %5 = load double, ptr %b.addr, align 8
  %add = fadd double %4, %5
  store double %add, ptr %retval, align 8
  br label %return

sw.bb2:                                           ; preds = %entry
  %6 = load double, ptr %a.addr, align 8
  %7 = load double, ptr %b.addr, align 8
  %sub = fsub double %6, %7
  store double %sub, ptr %retval, align 8
  br label %return

sw.bb3:                                           ; preds = %entry
  %8 = load double, ptr %a.addr, align 8
  %9 = load double, ptr %b.addr, align 8
  %mul = fmul double %8, %9
  store double %mul, ptr %retval, align 8
  br label %return

sw.bb4:                                           ; preds = %entry
  %10 = load double, ptr %b.addr, align 8
  %cmp = fcmp une double %10, 0.000000e+00
  %11 = select i1 %cmp, i64 1, i64 0
  %12 = getelementptr [2 x ptr], ptr @_Z9calculateddc_IndirectBrTargets, i64 0, i64 %11
  %EncDestAddr = load ptr, ptr %12, align 8
  %13 = getelementptr i8, ptr %EncDestAddr, i64 9
  indirectbr ptr %13, [label %if.then, label %if.else]

if.then:                                          ; preds = %sw.bb4
  %14 = load double, ptr %a.addr, align 8
  %15 = load double, ptr %b.addr, align 8
  %div = fdiv double %14, %15
  store double %div, ptr %retval, align 8
  br label %return

if.else:                                          ; preds = %sw.bb4
  store double -1.000000e+00, ptr %retval, align 8
  br label %return

sw.default:                                       ; preds = %entry
  store double -1.000000e+00, ptr %retval, align 8
  br label %return

return:                                           ; preds = %sw.default, %if.else, %if.then, %sw.bb3, %sw.bb2, %sw.bb
  %16 = load double, ptr %retval, align 8
  ret double %16
}

declare i32 @printf(ptr noundef, ...) #1

define private void @goron_decrypt_string_0(ptr nocapture %plain_string, ptr nocapture %data) {
Enter:
  %0 = getelementptr inbounds i8, ptr %data, i32 23
  %1 = load i32, ptr @dec_status_0.str, align 4
  %2 = icmp eq i32 %1, 1
  %3 = select i1 %2, i64 5, i64 1
  %4 = getelementptr [6 x ptr], ptr @goron_decrypt_string_0_IndirectBrTargets, i64 0, i64 %3
  %EncDestAddr = load ptr, ptr %4, align 8
  %5 = getelementptr i8, ptr %EncDestAddr, i64 9
  indirectbr ptr %5, [label %Enter.Exit_crit_edge, label %Enter.LoopBody_crit_edge]

Enter.LoopBody_crit_edge:                         ; preds = %Enter
  br label %LoopBody

Enter.Exit_crit_edge:                             ; preds = %Enter
  br label %Exit

LoopBody:                                         ; preds = %LoopEnd.LoopBody_crit_edge, %Enter.LoopBody_crit_edge
  %6 = phi i32 [ 0, %Enter.LoopBody_crit_edge ], [ %29, %LoopEnd.LoopBody_crit_edge ]
  %7 = phi i8 [ 0, %Enter.LoopBody_crit_edge ], [ %27, %LoopEnd.LoopBody_crit_edge ]
  %8 = getelementptr inbounds i8, ptr %0, i32 %6
  %9 = load volatile i8, ptr %8, align 1
  %10 = urem i32 %6, 23
  %11 = getelementptr inbounds i8, ptr %data, i32 %10
  %12 = load i8, ptr %11, align 1
  %13 = zext nneg i8 %12 to i32
  %14 = mul nuw nsw i32 %10, %13
  %15 = and i32 %14, 1
  %16 = icmp eq i32 %15, 0
  %17 = select i1 %16, i64 3, i64 2
  %18 = getelementptr [6 x ptr], ptr @goron_decrypt_string_0_IndirectBrTargets, i64 0, i64 %17
  %EncDestAddr1 = load ptr, ptr %18, align 8
  %19 = getelementptr i8, ptr %EncDestAddr1, i64 9
  indirectbr ptr %19, [label %LoopBr0, label %LoopBr1]

LoopBr0:                                          ; preds = %LoopBody
  %20 = add i8 %9, %7
  %21 = xor i8 %20, %12
  %22 = xor i8 %21, -1
  br label %LoopEnd

LoopBr1:                                          ; preds = %LoopBody
  %23 = sub i8 %9, %7
  %24 = xor i8 %23, %12
  %25 = sub i8 0, %24
  br label %LoopEnd

LoopEnd:                                          ; preds = %LoopBr1, %LoopBr0
  %26 = phi i8 [ %22, %LoopBr0 ], [ %25, %LoopBr1 ]
  %27 = xor i8 %26, %12
  %28 = getelementptr inbounds i8, ptr %plain_string, i32 %6
  store i8 %27, ptr %28, align 1
  %29 = add nuw nsw i32 %6, 1
  %30 = icmp eq i32 %29, 31
  %31 = select i1 %30, i64 0, i64 4
  %32 = getelementptr [6 x ptr], ptr @goron_decrypt_string_0_IndirectBrTargets, i64 0, i64 %31
  %EncDestAddr2 = load ptr, ptr %32, align 8
  %33 = getelementptr i8, ptr %EncDestAddr2, i64 9
  indirectbr ptr %33, [label %UpdateDecStatus, label %LoopEnd.LoopBody_crit_edge]

LoopEnd.LoopBody_crit_edge:                       ; preds = %LoopEnd
  br label %LoopBody

UpdateDecStatus:                                  ; preds = %LoopEnd
  store i32 1, ptr @dec_status_0.str, align 4
  br label %Exit

Exit:                                             ; preds = %Enter.Exit_crit_edge, %UpdateDecStatus
  ret void
}

attributes #0 = { mustprogress noinline optnone ssp uwtable(sync) "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+altnzcv,+ccdp,+ccidx,+complxnum,+crc,+dit,+dotprod,+flagm,+fp-armv8,+fp16fml,+fptoint,+fullfp16,+jsconv,+lse,+neon,+pauth,+perfmon,+predres,+ras,+rcpc,+rdm,+sb,+sha2,+sha3,+specrestrict,+ssbs,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8a,+zcm,+zcz" }
attributes #1 = { "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+altnzcv,+ccdp,+ccidx,+complxnum,+crc,+dit,+dotprod,+flagm,+fp-armv8,+fp16fml,+fptoint,+fullfp16,+jsconv,+lse,+neon,+pauth,+perfmon,+predres,+ras,+rcpc,+rdm,+sb,+sha2,+sha3,+specrestrict,+ssbs,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8a,+zcm,+zcz" }

!llvm.module.flags = !{!0, !1, !2, !3, !4}
!llvm.ident = !{!5}

!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 15, i32 4]}
!1 = !{i32 1, !"wchar_size", i32 4}
!2 = !{i32 8, !"PIC Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 1}
!4 = !{i32 7, !"frame-pointer", i32 1}
!5 = !{!"clang version 19.1.3 (git@github.com:zylc369/Arkari.git 3bc59233aa293f1dbef21275a7697db9bca86f2f)"}
